package com.toweave.starter.utils;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.util.Log;
import android.view.View;
import android.view.inputmethod.InputMethodManager;

public class SystemUtil {
  public static void hideSoftInputFromWindow(Activity act, View v) {
    // 从系统服务获取输入法管理器
    InputMethodManager imm = (InputMethodManager) act.getSystemService(Context.INPUT_METHOD_SERVICE);
    // 关闭屏幕上的软件输入法
    imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
  }


  @SuppressLint("HardwareIds")
  public static String getMacAddressFull(Activity act) {
    WifiManager wifiManager = (WifiManager) act.getSystemService(Context.WIFI_SERVICE);
    WifiInfo info = wifiManager.getConnectionInfo();
    Log.i("-liz- WifiInfo ", String.valueOf(info.getApMldMacAddress()));
    Log.i("-liz- WifiInfo ", String.valueOf(info.getMacAddress()));
    Log.i("-liz- WifiInfo ", info.toString());
    return info.getMacAddress();
  }
}
